package android.longs.study.utils;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;


public class H3Utils {



    //提供一个工厂 (链式操作)
    private static SessionFactory factory = 
	    new Configuration()
    .configure("android/longs/study/config/hibernate.cfg.xml")
    .buildSessionFactory();

    /**
     * 获得线程绑定的session
     * @return
     */
    public static Session getCurrentSession(){
	return factory.getCurrentSession();
    }

}
